package com.hsoft.zhxy.app.xtgl_02_01.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hsoft.zhxy.app.common.model.entity.JcqxYh;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hsoft.zhxy.app.xtgl_02_01.model.query.YhglQuery;
import com.hsoft.zhxy.app.xtgl_02_01.model.vo.YhglVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

/**
 * All rights Reserved, Designed By 哈尔滨工业大学软件工程股份有限公司
 *
 * @Title: 用户 DAO层接口
 * @Package
 * @Description:
 * @author: system
 * @date: 2020-10-23
 */
@Mapper
@Repository
public interface JcqxYhMapper extends BaseMapper<JcqxYh> {

    /**
     * 查询用户基础信息数据(分页)
     * @param page
     * @param queryWrapper
     * @return IPage<YhglVO>
     */
    @Select("<script> " +
            "   select  yh.yhid,\n" +
            "           yh.xm,\n" +
            "           yh.sjh,\n" +
            "           yh.dzyx,\n" +
            "           yh.sfms,\n" +
            "           yh.sfzj,\n" +
            "           yh.kdlfs,\n" +
            "           yh.yhzt,\n" +
            "           yh.sjlybz,\n" +
            "           yh.bz,\n" +
            "           yh.cjsj,\n" +
            "           yh.bgsj,\n" +
            "           js.jsid,\n" +
            "           js.jsmc,\n" +
            "           bm.bmmc,\n" +
            "           bm.bmm\n" +
            "  from jcqx_yh yh\n" +
            "  left join jcqx_yhbm yhbm\n" +
            "    on yh.yhid = yhbm.yhid\n" +
            "  left join jcqx_bm bm\n" +
            "    on yhbm.bmm = bm.bmm\n" +
            "  left join jcqx_yhjs yhjs\n" +
            "    on yh.yhid = yhjs.yhid\n" +
            "  left join jcqx_js js\n" +
            "    on js.jsid = yhjs.jsid\n" +
            "  ${ew.customSqlSegment} " +    //获取条件构造器中拼接好的sql
            "</script>")
    IPage<YhglVO> getYhPageList(Page<YhglQuery> page, @Param("ew") QueryWrapper<YhglQuery> queryWrapper);

}